﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MEF_Test.Bricks;
using System.Windows;
using System.IO;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition;




namespace ModuleOne
{
    public class DiskBrowserNode : BrowserNodeBase
    {
       
        public DiskBrowserNode(string path) : base()
        {
            Path = path;
            // TODO : Use a factory to create the right MediaHandler.
            // A MediaHandler is a class in charge of knowing he fileformat (or the service providing metadatas about the file itself)
            // which will provide infos about the Media file such as size, rating, artwork, genre, running time, framerate, ...
            // for instance, the MediaHandler for avi files and for mkv files will be different, because these infos are not located at the same place.
            // Same for jiwa, synology's AudioStation, Spotify (non-DiskBrowserNode BrowserNodeBases) : the infos are not even located in the file, but rather on a service providing the file.
            // in these cases, the MediaHandler is in charge of fetching those metadata infos, and exposing them as well as the template to use those values.
            // MediaHandler = new 
        }

        // this is the only method where we should access the backing private field _acceptedActions for optimization purposes (avoid calling the property getter)
        protected override void populateAcceptedActions()
        {
            _acceptedActions.Add("Delete");
            _acceptedActions.Add("Share");
            if ((new FileInfo(Path)).Attributes.HasFlag(FileAttributes.Directory) == false)
            {
                _acceptedActions.Add("Open");
            }
            else
            {
                _acceptedActions.Add("BrowseTo");
            }
            

        }

        public string Path { get; set; }


    }
}
